package org.dxy.api.dto.request.substitute;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Positive;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 添加替代料请求DTO
 * @author dxy
 * @createTime 2025/9/13
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AddSubstituteMaterialRequest {
    
    /** MBOM项ID */
    @NotNull(message = "MBOM项ID不能为空")
    private Long mbomItemId;
    
    /** 替代料物料ID */
    @NotNull(message = "替代料物料ID不能为空")
    private Long substituteMaterialId;
    
    /** 替代比例 */
    @NotNull(message = "替代比例不能为空")
    @Positive(message = "替代比例必须大于0")
    private BigDecimal substituteRatio;
    
    /** 优先级 */
    @NotNull(message = "优先级不能为空")
    @Positive(message = "优先级必须大于0")
    private Integer priority;
    
    /** 有效期开始 */
    private LocalDateTime validFrom;
    
    /** 有效期结束 */
    private LocalDateTime validTo;
}